package com.example.administrator.netdemo.network;


import java.io.IOException;

import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by luquan on 2017/2/9.
 */

public class ParameterInterceptor implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request();
         //所有接口都要传的参数
        HttpUrl httpUrl = request.url().newBuilder()
//                .addQueryParameter("IM_OUT", "JSN-V1.0")
//                .addQueryParameter("IM_PST", "1")
//                .addQueryParameter("IM_AppID", BuildConfig.API_APPID)
                .build();
         request = request.newBuilder().url(httpUrl).build();
        return chain.proceed(request);
    }

}
